const a = async function (
  _,
  _01,
  _02,
  { dc: { http, reload, message }, XLSX }
) {
  const data = await analyzExcel(XLSX);
  if (data.length && data.length > 6) {
    const list = data.slice(5);
    const keys = {
      a: "resourceProgram",
      b: "resourceYs2023",
      c: "resourceJs2023",
      d: "resourceYs2024",
      e: "resourceZx2024",
      f: "resourceZxl2024",
      g: "applyProgram",
      h: "applyYs2023",
      i: "applyJs2023",
      j: "applyYs2024",
      k: "applyZx2024",
      l: "applyZxl2024",
      m: "remark",
    };
    const imp0List = [];
    list.forEach((row) => {
      const addRow = {};
      Object.keys(keys).forEach((key) => {
        addRow[keys[key]] = row[key];
      });
      imp0List.push(addRow);
    });
    imp0List.forEach((i, index) => {
      i.sortNo = index + 1;
    });
    await http.post({
      url: "/ypxy/reportImport/reportImport0",
      data: { imp0List },
    });
    message.success("导入成功");
    reload();
  }
};
